import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../layout/index.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'index',
      component: HomeView
    },
    {
      path: "/system",
      name: "系统管理",
      component: HomeView,
      children: [
        {
          path: "user",
          name: "用户管理",
          component: () => import('../views/system/user.vue')
        },
        {
          path: "menu",
          name: "菜单管理",
          component: () => import('../views/system/user.vue')
        },
        {
          path: "role",
          name: "角色管理",
          component: () => import('../views/system/role.vue')
        }

      ]
    },
    {
      path:"/login",
      name:"登录",
      component:() => import('../views/login.vue')
    },

    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')
    }
  ]
})

export default router
